package scau.erps.view.decision.sand;

import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JPanel;

public class FactoryPanel extends JPanel {
	private static final long serialVersionUID = 1L;
	private JPanel factoryPanel;
	public FactoryPanel(){
		factoryPanel = new JPanel(new GridLayout(1,2));	
		JPanel bigFactory = new JPanel();
		bigFactory.setBorder(BorderFactory.createTitledBorder("大厂房"));
		bigFactory.setLayout(new GridLayout(1,4));
		LinePanel line1 = new LinePanel("Beryl","手工线",3);
		LinePanel line2 = new LinePanel("Beryl","手工线",2);
		LinePanel line3 = new LinePanel("Beryl","手工线",2);
		LinePanel line4 = new LinePanel("Beryl","半自动",8);				
		bigFactory.add(line1);
		bigFactory.add(line2);
		bigFactory.add(line3);
		bigFactory.add(line4);		
		JPanel middleFactory = new JPanel();
		middleFactory.setBorder(BorderFactory.createTitledBorder("中/小厂房"));		
		middleFactory.setLayout(new GridLayout(1,3));
		LinePanel line5= new LinePanel("Crystal","全自动",12);
		LinePanel line6 = new LinePanel(null,"柔性线",9);
		LinePanel line7 = new LinePanel(null,null,0);
		LinePanel line8 = new LinePanel(null,null,0);	
		middleFactory.add(line5);
		middleFactory.add(line6);
		middleFactory.add(line7);
		middleFactory.add(line8);		
		factoryPanel.add(bigFactory);
		factoryPanel.add(middleFactory);		
		this.add(factoryPanel);
	}
	public void setDimension(Dimension d){
		this.factoryPanel.setPreferredSize(d);
	}
}
